package annotationLearn;

/**
 * Gender
 *
 * @author nanxin.chen
 * @date 2015/10/31
 */
public enum GenderEnum {
    MAN(1,"男"),WOMAN(2,"女");

    private String describe;
    private int num;

    GenderEnum(int num, String describe) {
        this.describe = describe;
        this.num = num;
    }

    public static String getGender(int i) {
        for (GenderEnum m : GenderEnum.values()) {
            if (m.getNum() == i) {
                return m.getDescribe();
            }
        }
        return "";
    }

    public String getDescribe() {
        return describe;
    }

    public int getNum() {
        return num;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    public void setNum(int num) {
        this.num = num;
    }
}
